﻿'use strict';

(function () {
    function l(name) {
        var str = abp.localization.localize(name, "WeChat");
        if (str === name) return app.localize(name);
        return str;
    }
    $(function () {
        var weChatUserApiSettingAppService = abp.services.weChat.weChatApiSetting;

        //Save settings
        $('#SaveAllSettingsButton').click(function () {
            weChatUserApiSettingAppService.updateAllSettings({
                weChatApiSetting: $('#WeChatApiSettingForm').serializeFormToObject(),
                weChatPayApiSetting: $('#WeChatPayApiSettingForm').serializeFormToObject()
            }).done(function () {
                abp.notify.info(l('SavedSuccessfully'));
            });
        });
    });
})();

